package com.android.tnovoselec.schedule.adapter;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.android.tnovoselec.schedule.R;
import com.android.tnovoselec.schedule.fragment.ScheduleDayFragment;

public class ScheduleFragmentAdapter extends FragmentPagerAdapter {

	Context mContext;
	String[] days;

	public ScheduleFragmentAdapter(FragmentManager fm, Context mContext) {
		super(fm);
		this.mContext = mContext;
		days = mContext.getResources().getStringArray(R.array.days);
	}

	@Override
	public Fragment getItem(int position) {
		ScheduleDayFragment sdf = new ScheduleDayFragment();
		Bundle args = new Bundle();
		args.putInt("position", position);
		sdf.setArguments(args);
		return sdf;
	}

	@Override
	public int getCount() {

		return days.length;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return days[position];
	}

}
